package com.supcon.exchangedata.repository.slave2;


import com.supcon.exchangedata.pojo.entity.mysql.operation.hj.GasDailyOpertionInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

import java.time.LocalDateTime;


/**
 * Created with IntelliJ IDEA.
 *
 * @Author: yangbin
 * @Date: 2022/04/20/9:00
 * @Description:
 */
public interface SlaveTwoGasDailyOperationInfo  extends JpaRepository<GasDailyOpertionInfo, Long> {


    @Transactional
    @Query(nativeQuery = true, value = "SELECT * FROM gas_daily_opertion_info WHERE data_time = (SELECT MAX(data_time) FROM gas_daily_opertion_info)")
    GasDailyOpertionInfo findTopData();


    GasDailyOpertionInfo findByDataTime(LocalDateTime dataTime);
}
